$(function () {

    //日历交互
    lectureDateFn();

    //日历交互
    function lectureDateFn() {
        var _flag = false,
            _bo = $('body');

        _bo.on('click', '.lectureDateBtn', function () {
            if (_flag) {
                _bo.removeClass('lecture-open');
                _flag = false
            } else {
                _bo.addClass('lecture-open');
                _flag = true
            }
            //区域刷新 重置滚动条
            $('.infinite-scroll').scroller('refresh');
        });

        //初始化日历，选择日期并触发
        $('section.lecture-date-bx').calendar({
            onChange: function (o, timestamps, date) {
                loadOpenCourse(1, new Date(date));
            }
        })
    }
});